<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?></head>
<div id="page1">
<div id="wrapper">
	<?php $this->load->view('admin_views/header'); ?><hr />
    <script type="text/javascript">
            //for unit
            $(document).ready( function() {
                $("#intid_unit").autocomplete({
                    minLength: 2,
                    source:
                        function(req, add){
                        $.ajax({
                            url: "<?php echo base_url(); ?>penjualan/lookupUnit",
                            dataType: 'json',
                            type: 'POST',
                            data: req,
                            success:
                                function(data){
                                if(data.response =="true"){
                                    add(data.message);
                                }
                            },
                        });
                    },
                    select:
                        function(event, ui) {
                        $("#result").append(
                        "<input type='hidden' id='id_unit' name='id_unit' value='" + ui.item.id + "' size='10' />"
                    );
                    },
                });
				
				$("#strnama_dealer").autocomplete({
                    minLength: 2,
                    source:
                        function(req, add){
                        $.ajax({
                            url: "<?php echo base_url(); ?>penjualan/lookupManager",
                            dataType: 'json',
                            type: 'POST',
                            data: {
                                term: req.term/*,
                                state: $('#id_unit').val(),*/

                            },
                            success:
                                function(data){
                                if(data.response =="true"){
                                    add(data.message);
                                }
                            },
                        });
                    },
                    select:
                        function(event, ui) {
                        $("#result").append(
                        "<input type='hidden' align='top' id='intid_unit' name='intid_unit' value='" + ui.item.id + "'/>"
                    );
                    },
                });
	});
	</script>
</div>

	<div id="page">
	<div id="page-bgtop">
		<div id="content">
        <div class="post">
          <fieldset>
		<legend><strong>CETAK LAPORAN REKAP PV</strong></legend>
        <form action="<?php echo base_url()?>laporan/cetakrekappv" method="post" target="_blank">            
 		<table width="95%" border="0" cellpadding="0" cellspacing="0" id="data" align="center">
            <tr>
            <td>&nbsp;PERIODE</td>
            <td><input type="text" name="tglstart" id="demo2" maxlength="25" size="25" class="text_box" />
          <a href="javascript:NewCssCal('demo2','yyyymmdd')"> <img src="<?php echo base_url();?>images/cal.gif" width="16" height="16" alt="Pick a date" /></a>&nbsp;&nbsp;TO&nbsp;&nbsp;<input type="text" name="tglend" id="demo3" size="25" /><a href="javascript:NewCssCal('demo3','yyyymmdd')"> <img src="<?php echo base_url();?>images/cal.gif" width="16" height="16" alt="Pick a date" /></a></td>
          </tr>
            <tr>
        		<td>&nbsp;JENIS PENJUALAN</td>
        		<td><select name="intid_jpenjualan" id="intid_jpenjualan">
                  <option value="">-- Pilih --</option>
                  <?php
                   for($i=0;$i<count($strnama_jpenjualan);$i++) {
                        echo "<option value='$intid_jpenjualan[$i]'>$strnama_jpenjualan[$i]</option>";
                   }
                   ?>
                </select></td>
            </tr>
            <tr>
           		<th></th>
            	<td><input type="submit" value="Cetak" class="button" id="submit"/>
        			 &nbsp;
              		<input class="button" type="button" value="Cancel" onclick="location.href='index';"/></td>
                    <div id=result></div>
           </tr>
		</table>	
        </form>  
        </fieldset>
         </div>
			</div>
			
		</div>
		<!-- end #content -->
		<?php $this->load->view('admin_views/sidebar_laporan'); ?><!-- end #sidebar -->
		<div style="clear: both;">&nbsp;</div>
	</div>
	</div>
	<!-- end #page -->
	<div id="footer-bgcontent">
	<?php $this->load->view('admin_views/footer'); ?></div>
	<!-- end #footer -->

